In recent years, a memory device has been proposed in which a high-resistance film is provided between a metal film and an opposing electrode and the electrical resistance value of the high-resistance film is changed by causing ions of the metal included in the metal film to diffuse inside the high-resistance film to cause filaments to form or disappear. In such a memory device, it is necessary to shrink the structure to increase the bit density. However, it is a problem that the characteristics become unstable when the structure is shrunk.